/**
 * CustomerSource枚举
 *
 * @author sxf
 * @email sxf02615@163.com
 * @date 2025/1/15
 */
package com.sxf.crm.enums;

import java.util.Arrays;    

public enum CustomerSource {
    TELEMARKETING("电话营销"),
    WEBSITE("官网"),
    SOCIAL_MEDIA("社交媒体"),
    REFERRAL("客户推荐"),
    EXHIBITION("展会"),
    SEARCH_ENGINE("搜索引擎"),
    EMAIL_MARKETING("邮件营销"),
    PARTNER("合作伙伴"),
    OTHER("其他"),
    CLUE("线索");

    private final String description;

    CustomerSource(String description) {
        this.description = description;
    }

    public String getDescription() {
        return description;
    }

    public static CustomerSource fromString(String value) {
        return Arrays.stream(CustomerSource.values())
            .filter(source -> source.name().equalsIgnoreCase(value))
            .findFirst()
            .orElse(null);
    }
} 